package cn.pupil.springframework.context.event;

import cn.pupil.springframework.context.ApplicationEvent;
import cn.pupil.springframework.context.ApplicationListener;

/**
 * @Description: 事件广播器
 * @Author: pupil
 * @Date: 2024/11/13 上午 11:53
 */
public interface ApplicationEventMulticaster {

    /**
     * Add a listener to be notified of all events.
     * 添加监听器
     *
     * @param listener listener the listener to add
     */
    void addApplicationListener(ApplicationListener<?> listener);

    /**
     * Remove a listener from the notification list.
     * 删除监听器
     *
     * @param listener the listener to remove
     */
    void removeApplicationListener(ApplicationListener<?> listener);

    /**
     * Multicast the given application event to appropriate listeners.
     * 广播事件，处理事件的接收
     *
     * @param event the event to multicast
     */
    void multicastEvent(ApplicationEvent event);
}
